# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=expat
pkgver=2.5.0
pkgrel=2
pkgdesc="XML Parser library written in C"
url="https://libexpat.github.io/"
arch="all"
license="MIT"
checkdepends="bash"
source="https://downloads.sourceforge.net/project/expat/expat/$pkgver/expat-$pkgver.tar.bz2"
# pull in xmlwf for dev
depends_dev="$pkgname=$pkgver-r$pkgrel"
# Order matters, ensure -dev does not gobble up static libraries.
subpackages="$pkgname-static $pkgname-dev $pkgname-doc lib$pkgname:libs"

# secfixes:
#   2.5.0-r0:
#     - CVE-2022-43680
#   2.4.9-r0:
#     - CVE-2022-40674
#   2.4.5-r0:
#     - CVE-2022-25235
#     - CVE-2022-25236
#     - CVE-2022-25313
#     - CVE-2022-25314
#     - CVE-2022-25315
#   2.4.4-r0:
#     - CVE-2022-23852
#     - CVE-2022-23990
#   2.4.3-r0:
#     - CVE-2021-45960
#     - CVE-2021-46143
#     - CVE-2022-22822
#     - CVE-2022-22823
#     - CVE-2022-22824
#     - CVE-2022-22825
#     - CVE-2022-22826
#     - CVE-2022-22827
#   2.2.7-r1:
#     - CVE-2019-15903
#   2.2.7-r0:
#     - CVE-2018-20843
#   2.2.0-r1:
#     - CVE-2017-9233

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--enable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir/" install
}

sha512sums="
22fd904d75aab7506a85c03519b9cf79e44898c8e1ba6abf6cb7f95de71b8e63a7e2d5cf4395e3627d46035ea29342b3e631a8809fef8aad3f59976dc075ad17  expat-2.5.0.tar.bz2
"
